﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Specialized;
using com.hisun.iposm.net;
using pay.BLL;
using pay.DAL;
using pay.Entity;
using System.Collections.Generic;
public partial class callback : System.Web.UI.Page
{
    public static log4net.ILog log = log4net.LogManager.GetLogger(typeof(callback));
    protected void Page_Load(object sender, EventArgs e)
    {
        //支付结果通知
        NameValueCollection param = Request.Params;
        MerchantPayResult res = null;
        try
        {
            res = HiSunTransEngine.payResult(param);
            if (res.status == "SUCCESS")
            {
               
                string tel = "";
                if (!string.IsNullOrEmpty(res.reserved))
                {
                    tel = res.reserved;
                    //Session["tel"] = res.reserved;
                }
                else
                {
                    return;
                }
               
               // Response.Redirect("http://pay.emoney.cn/guChina/shopping33.aspx?orderId=" + res.orderId + "&msg=success");
               // Response.Redirect("http://pay.emoney.cn/guChina/shopping33.aspx?orderId=" + res.orderId + "&msg=success&ext1="+tel);
                Response.Redirect("http://localhost:33213/pay/guChinatest/shopping33.aspx?orderId=" + res.orderId + "&msg=success&ext1=" + tel);

            }
            else
            {
                //orderId.Text = res.orderId;
                //amount.Text = "" + res.amount;
                //banks.Text = res.banks;
                //mobile.Text = res.mobile;
                //message.Text = res.status;

                Response.Redirect("http://localhost:33213/pay/guChinatest/kuaiqian/show.aspx?msg=false");

            }


        }
        catch
        { }
            
       }
      
       
        //errMsg.Text = res.errMsg;
        //returnCode.Text = res.returnCode;
        //message.Text = res.message;
        //status.Text = res.status;

        //amount.Text = "" + res.amount;
        //amtItem.Text = "" + res.amtItem;
        //banks.Text = res.banks;
        //contractName.Text = res.contractName;
        //invoiceTitle.Text = res.invoiceTitle;
        //mobile.Text = res.mobile;
        //orderId.Text = res.orderId;
        //payDate.Text = res.payDate;
        //payNo.Text = res.payNo;
        //authorizeNo.Text = res.authorizeNo;
        //reserved.Text = res.reserved;
        

    
}
